

#ifndef   _UCPLPLOTENGINE_H
#define   _UCPLPLOTENGINE_H

#include "zAdAChar.h"
#include "zacpl.h"
#include "zacplobject.h"

class UcViewport;
class PlotEnvironment;
class UcPlPlotProgress;
class UcPlPlotInfo;
class UcDbPlotSettings;
class UcPlPlotConfig;

enum PreviewStatus {
    kNormal = 0,
    kPlot,
    kCancel,
    kNext,
    kPrevious
};

struct UCPL_PREVIEWENDPLOT {
    PreviewStatus nStatus;
};

class UcPlPlotPageInfo : public UcPlObject
{
    UCPL_DECLARE_MEMBERS(UcPlPlotPageInfo);

public:
    UCPL_PORT UcPlPlotPageInfo();
    UCPL_PORT virtual ~UcPlPlotPageInfo();

    UCPL_PORT ZSoft::Int32 entityCount() const;
    UCPL_PORT ZSoft::Int32 rasterCount() const;
    UCPL_PORT ZSoft::Int32 oleObjectCount() const;
    UCPL_PORT ZSoft::Int32 gradientCount() const;
    UCPL_PORT ZSoft::Int32 shadedViewportType() const;
};

#ifndef _ZSOFT_WINDOWS_
class UCPL_PORT UcPlPlotEngine{
#else
class ZSOFT_NO_VTABLE UcPlPlotEngine {
#endif 
public:
    virtual Ucad::ErrorStatus beginPlot(UcPlPlotProgress* pPlotProgress, void* pParams = NULL);
    virtual Ucad::ErrorStatus endPlot(void* pParams = NULL);

    virtual Ucad::ErrorStatus beginDocument(UcPlPlotInfo& plotInfo, 
                                            const ZTCHAR * pDocname,
                                            void *pParams = NULL,
                                            ZSoft::Int32 nCopies = 1, 
                                            bool bPlotToFile = false, 
                                            const ZTCHAR * pFileName = NULL);
    virtual Ucad::ErrorStatus endDocument(void* pParams = NULL);

    virtual Ucad::ErrorStatus beginPage(UcPlPlotPageInfo& pageInfo, 
                                        UcPlPlotInfo& plotInfo, 
                                        bool bLastPage, 
                                        void* pParams = NULL);
    virtual Ucad::ErrorStatus endPage(void* pParams = NULL);
    
    virtual Ucad::ErrorStatus beginGenerateGraphics(void* pParams = NULL);
    virtual Ucad::ErrorStatus beginGenerateGraphics(UcViewport*& pViewport, void* pParams = NULL);
    virtual Ucad::ErrorStatus endGenerateGraphics(void* pParams = NULL);
    
    virtual void destroy();
    virtual bool isBackgroundPackaging() const;
};

#endif 
